package org.nimi317.web_gis.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nimi317.web_gis.form.post.StationRenderPost;
import org.nimi317.web_gis.entity.StationQuality;
import org.nimi317.web_gis.service.impl.AreaCodeException;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author nimi317
 * @since 2024-01-03
 */
public interface IStationQualityService extends IService<StationQuality> {

    /**
     * 实时更新空气质量数据
     *
     * @return
     */
    boolean updateQualityData() throws AreaCodeException;

    /**
     * 获取最近24小时的空气质量数据
     */
    List<StationQuality> getRecentQualityData(String id);

    /**
     * 获取最新更新时间
     *
     * @return 更新时间
     */
    LocalDateTime getLastUpdateTime();

    List<StationQuality> getHistory(StationRenderPost post);

    IPage<StationQuality> getHistory(String id, List<LocalDateTime> timeRange,Integer current,Integer size);

    List<StationQuality> getHistory(String id, List<LocalDateTime> timeRange);
}
